/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86138
 * Date: 2024-10-11
 * Time: 15:30
 */
public class October_11 {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();
        binaryTree.preOrder(root);
        System.out.println();
        binaryTree.inOrder(root);
        System.out.println();
        binaryTree.postOrder(root);
        System.out.println();
        // 获取树中节点的个数
        binaryTree.size(root);
        int count = BinaryTree.nodeCount;
        System.out.println(count);
        // 获取叶子节点的个数
        binaryTree.getLeafNodeCount(root);
        int leaveCount = BinaryTree.leaveCount;
        System.out.println(leaveCount);
        // 获取第K层节点的个数
        int kCount = binaryTree.getKLevelNodeCount(root,4);
        System.out.println(kCount);
        // 获取二叉树的高度
        int height = binaryTree.getHeight(root);
        System.out.println(height);
        // 检测值为value的元素是否存在
        BinaryTree.TreeNode ret = binaryTree.find(root,'D');
        System.out.println(ret.val);
    }
}
